package com.keti.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.keti.Dao.RecordDao;
import com.keti.DaoImpl.RecordDaoImpl;
import com.keti.pojo.record;


/**
 * Servlet implementation class ShowRecordServlet
 */
@WebServlet("/ShowRecordServlet")
public class ShowRecordServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		RecordDao rd = new RecordDaoImpl();
		List<record> list = new ArrayList<record>();
		list = rd.querryAll();
		request.setAttribute("list", list);
		request.getRequestDispatcher("/jsp"
				+ "/ShowRecord.jsp").forward(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
